import React, { Component } from 'react'
import { connect } from 'react-redux'
class ConnectDemo extends Component {
  render() {
    return (
      <div>
        <h3>connect获取值组件</h3>
        <button onClick={() => {
          console.log('connect获取值')
          console.log(this.props);
          console.log(this.props.userInfo);
        }}>获取数据</button>
      </div>
    )
  }
}
const fn = (state) => {
  console.log(state);
  return {
    userInfo: state.loginReducer.userInfo
  }
}
export default connect(fn, null)(ConnectDemo)